home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / X11 / PassivGraI.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-02-14  |  5.5 KB  |  187 lines

  1. /*
  2. * $Xorg: PassivGraI.h,v 1.4 2001/02/09 02:03:56 xorgcvs Exp $
  3. */
  4.  
  5. /********************************************************
  6.  
  7. Copyright 1988 by Hewlett-Packard Company
  8. Copyright 1987, 1988, 1989 by Digital Equipment Corporation, Maynard
  9.  
  10. Permission to use, copy, modify, and distribute this software 
  11. and its documentation for any purpose and without fee is hereby 
  12. granted, provided that the above copyright notice appear in all 
  13. copies and that both that copyright notice and this permission 
  14. notice appear in supporting documentation, and that the names of 
  15. Hewlett-Packard or Digital not be used in advertising or 
  16. publicity pertaining to distribution of the software without specific, 
  17. written prior permission.
  18.  
  19. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  20. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  21. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  22. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  23. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  24. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  25. SOFTWARE.
  26.  
  27. ********************************************************/
  28.  
  29. /*
  30.  
  31. Copyright 1987, 1988, 1989, 1998  The Open Group
  32.  
  33. Permission to use, copy, modify, distribute, and sell this software and its
  34. documentation for any purpose is hereby granted without fee, provided that
  35. the above copyright notice appear in all copies and that both that
  36. copyright notice and this permission notice appear in supporting
  37. documentation.
  38.  
  39. The above copyright notice and this permission notice shall be included in
  40. all copies or substantial portions of the Software.
  41.  
  42. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  43. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  44. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
  45. OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  46. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  47. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  48.  
  49. Except as contained in this notice, the name of The Open Group shall not be
  50. used in advertising or otherwise to promote the sale, use or other dealings
  51. in this Software without prior written authorization from The Open Group.
  52.  
  53. */
  54. /* $XFree86: xc/lib/Xt/PassivGraI.h,v 1.3 2001/12/14 19:56:27 dawes Exp $ */
  55.  
  56. #ifndef _PDI_h_
  57. #define _PDI_h_
  58.  
  59.  
  60. #define KEYBOARD TRUE
  61. #define POINTER  FALSE
  62.  
  63. typedef enum {
  64.     XtNoServerGrab, 
  65.     XtPassiveServerGrab,
  66.     XtActiveServerGrab,
  67.     XtPseudoPassiveServerGrab,
  68.     XtPseudoActiveServerGrab
  69. }XtServerGrabType;
  70.  
  71. typedef struct _XtServerGrabRec {
  72.     struct _XtServerGrabRec     *next;
  73.     Widget            widget;
  74.     unsigned int        ownerEvents:1;
  75.     unsigned int        pointerMode:1;
  76.     unsigned int        keyboardMode:1;
  77.     unsigned int        hasExt:1;
  78.     unsigned int        confineToIsWidgetWin:1;
  79.     KeyCode            keybut;
  80.     unsigned short        modifiers;
  81.     unsigned short        eventMask;
  82. } XtServerGrabRec, *XtServerGrabPtr;
  83.  
  84. typedef struct _XtGrabExtRec {
  85.     Mask            *pKeyButMask;
  86.     Mask            *pModifiersMask;
  87.     Window            confineTo;
  88.     Cursor            cursor;
  89. } XtServerGrabExtRec, *XtServerGrabExtPtr;
  90.  
  91. #define GRABEXT(p) ((XtServerGrabExtPtr)((p)+1))
  92.  
  93. typedef struct _XtDeviceRec{
  94.     XtServerGrabRec    grab;     /* need copy in order to protect
  95.                    during grab */
  96.     XtServerGrabType    grabType;
  97. }XtDeviceRec, *XtDevice;
  98.  
  99. #define XtMyAncestor    0
  100. #define XtMyDescendant    1
  101. #define XtMyCousin    2
  102. #define XtMySelf    3
  103. #define XtUnrelated    4
  104. typedef char XtGeneology; /* do not use an enum makes PerWidgetInput larger */
  105.  
  106. typedef struct {
  107.     Widget        focusKid;
  108.     XtServerGrabPtr    keyList, ptrList;
  109.     Widget        queryEventDescendant;
  110.     unsigned int    map_handler_added:1;
  111.     unsigned int    realize_handler_added:1;
  112.     unsigned int    active_handler_added:1;
  113.     unsigned int    haveFocus:1;
  114.     XtGeneology        focalPoint;
  115. }XtPerWidgetInputRec, *XtPerWidgetInput;
  116.  
  117. typedef struct XtPerDisplayInputRec{
  118.     XtGrabList     grabList;
  119.     XtDeviceRec keyboard, pointer;
  120.     KeyCode    activatingKey;
  121.     Widget     *trace;
  122.     int        traceDepth, traceMax;
  123.     Widget     focusWidget;
  124. }XtPerDisplayInputRec, *XtPerDisplayInput;
  125.  
  126. #define IsServerGrab(g) ((g == XtPassiveServerGrab) ||\
  127.              (g == XtActiveServerGrab))
  128.  
  129. #define IsAnyGrab(g) ((g == XtPassiveServerGrab) ||\
  130.               (g == XtActiveServerGrab)  ||\
  131.               (g == XtPseudoPassiveServerGrab))
  132.  
  133. #define IsEitherPassiveGrab(g) ((g == XtPassiveServerGrab) ||\
  134.                 (g == XtPseudoPassiveServerGrab))
  135.  
  136. #define IsPseudoGrab(g) ((g == XtPseudoPassiveServerGrab))
  137.  
  138. extern void _XtDestroyServerGrabs(
  139.     Widget        /* w */,
  140.     XtPointer        /* pwi */, /*XtPerWidgetInput*/
  141.     XtPointer        /* call_data */
  142. );
  143.  
  144. extern XtPerWidgetInput _XtGetPerWidgetInput(
  145.     Widget    /* widget */,
  146.     _XtBoolean    /* create */
  147. );
  148.  
  149. extern XtServerGrabPtr _XtCheckServerGrabsOnWidget(
  150.     XEvent*        /* event */,
  151.     Widget        /* widget */,
  152.     _XtBoolean        /* isKeyboard */
  153. );
  154.  
  155. /*
  156. extern XtGrabList* _XtGetGrabList( XtPerDisplayInput );
  157. */
  158.  
  159. #define _XtGetGrabList(pdi) (&(pdi)->grabList)
  160.  
  161. extern void _XtFreePerWidgetInput(
  162.     Widget        /* w */,
  163.     XtPerWidgetInput    /* pwi */
  164. );
  165.  
  166. extern Widget _XtProcessKeyboardEvent(
  167.     XKeyEvent*        /* event */,
  168.     Widget        /* widget */,
  169.     XtPerDisplayInput    /* pdi */
  170. );
  171.  
  172. extern Widget _XtProcessPointerEvent(
  173.     XButtonEvent*    /* event */,
  174.     Widget        /* widget */,
  175.     XtPerDisplayInput    /* pdi */
  176. );
  177.  
  178. extern void _XtRegisterPassiveGrabs(
  179.     Widget        /* widget */
  180. );
  181.  
  182. extern void _XtClearAncestorCache(
  183.     Widget        /* widget */
  184. );
  185.  
  186. #endif /* _PDI_h_ */
  187.